﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PrintDemandPlan.aspx.cs" Inherits="lcs.Web.DemandPlan.PrintDemandPlan" %>

<%@ Register Src="~/Controls/demandPlanInfo.ascx" TagPrefix="uc1" TagName="demandPlanInfo" %>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style type="text/css">
        a {
            text-decoration: none;
        }
    </style>
    <script language="javascript" type="text/javascript">

        function printpage(myDiv) {

            //var newstr = document.all.item(myDiv).innerHTML; 
            var newstr = document.getElementById(myDiv).innerHTML;
            //alert(newstr);
            var oldstr = document.body.innerHTML;
            document.body.innerHTML = newstr;
            window.print();
            document.body.innerHTML = oldstr;
            return false;
        }

        function dis() {
            var v = document.getElementById("pnl_contract");
            v.style.display = "none";
        }
    </script>
    <%
        Response.Buffer = true;
        Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
    %>
</head>
<body>
    <form id="form1" runat="server">

        <div id='myDiv'>
            <uc1:demandPlanInfo runat="server" ID="demandPlanInfo" />
        </div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
            <ContentTemplate>
                <div style="text-align: center;">
                    <asp:Panel runat="server" ID="pnl_contract">
                         采购订单号：<asp:TextBox ID="txt_orderNum" runat="server"></asp:TextBox>
                        &nbsp;
                         <asp:LinkButton ID="lbn_contract" runat="server" OnClick="lbn_contract_Click" Font-Bold="True" OnClientClick="dis()">生成合同</asp:LinkButton>
                    </asp:Panel>
                   &nbsp;
                     <asp:UpdateProgress ID="UpdateProgress1" runat="server" >
                         <ProgressTemplate>
                             <asp:Image ID="Image1" runat="server" Width="30px" Height="30px" ImageUrl="~/Images/progressbar.gif" />
                              <span style="font-weight: bold;  color: Red">正在生成合同，请稍等......</span>
                         </ProgressTemplate>
                     </asp:UpdateProgress>
                  
                </div>
                <div style="text-align: center; margin-top:10px;">
                      <asp:HyperLink ID="hy_download" runat="server" Font-Bold="True" NavigateUrl="#" Visible="false">请点击下载合同</asp:HyperLink>
                    &nbsp;&nbsp;
              <input type="button" id="bt" onclick="javascript: printpage('myDiv')" value=" 打印需求计划 " />
                </div>

            </ContentTemplate>
        </asp:UpdatePanel>



    </form>
</body>
</html>
